package com.service.impl;

import com.service.SecKillService;
import com.dao.inter.SecKillDao;
import com.dao.model.Product;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("secKillService")
public class SecKillServiceImpl implements SecKillService {
    @Autowired
    private SecKillDao dao;

    /**
     * 设置秒杀商品
     * @param product
     */
    public void setSecProduct(Product product) {
        dao.setSecProduct(product);
    }

    /**
     * 编辑秒杀商品
     * @param product
     */
    public void editSecProduct(Product product) {
        dao.editSecProduct(product);
    }

    /**
     * 查询秒杀商品
     * @return
     */
    public List<Product> querySecProduct(Product product) {
        return dao.querySecProduct(product);
    }

    /**
     * 查询秒杀商品总数
     * @return
     */
    public String querySecProductTotal(Product product) {
        return dao.querySecProductTotal(product);
    }

    @Override
    public Product queryProductById(String id) {
        return dao.queryProductById(id);
    }
}
